package huian.lee.entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the shopcate table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="shopcate"
 */

public abstract class BaseShopcate  implements Serializable {

	public static String REF = "Shopcate";
	public static String PROP_PARENT = "parent";
	public static String PROP_ID = "id";
	public static String PROP_CATENAME = "catename";


	// constructors
	public BaseShopcate () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseShopcate (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String catename;
	private java.lang.String parent;

	// collections
	private java.util.Set<huian.lee.entity.Shopinfo> shopinfos;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: catename
	 */
	public java.lang.String getCatename () {
		return catename;
	}

	/**
	 * Set the value related to the column: catename
	 * @param catename the catename value
	 */
	public void setCatename (java.lang.String catename) {
		this.catename = catename;
	}



	/**
	 * Return the value associated with the column: parent
	 */
	public java.lang.String getParent () {
		return parent;
	}

	/**
	 * Set the value related to the column: parent
	 * @param parent the parent value
	 */
	public void setParent (java.lang.String parent) {
		this.parent = parent;
	}



	/**
	 * Return the value associated with the column: shopinfos
	 */
	public java.util.Set<huian.lee.entity.Shopinfo> getShopinfos () {
		return shopinfos;
	}

	/**
	 * Set the value related to the column: shopinfos
	 * @param shopinfos the shopinfos value
	 */
	public void setShopinfos (java.util.Set<huian.lee.entity.Shopinfo> shopinfos) {
		this.shopinfos = shopinfos;
	}

	public void addToshopinfos (huian.lee.entity.Shopinfo shopinfo) {
		if (null == getShopinfos()) setShopinfos(new java.util.TreeSet<huian.lee.entity.Shopinfo>());
		getShopinfos().add(shopinfo);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof huian.lee.entity.Shopcate)) return false;
		else {
			huian.lee.entity.Shopcate shopcate = (huian.lee.entity.Shopcate) obj;
			if (null == this.getId() || null == shopcate.getId()) return false;
			else return (this.getId().equals(shopcate.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}